Skip to content

test: cover jsLikeAnalyzer computed object-property-key fallback - #537

Merged
askpt merged 1 commit into
mainfrom
repo-assist/test-jslike-computed-key-20260812-a84bc793dd6b204f
Aug 13, 2026
Merged

test: cover jsLikeAnalyzer computed object-property-key fallback#537
askpt merged 1 commit into
mainfrom
repo-assist/test-jslike-computed-key-20260812-a84bc793dd6b204f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This pull request was created by Repo Assist, an automated AI assistant.

Summary

Adds a unit test covering getFunctionName in jsLikeAnalyzer.ts for the case where an anonymous function_expression is assigned to a computed object property key (e.g. { [computedKey]: function() {} }). Previously this branch (line 228: keyNode?.type === "property_identifier" || keyNode?.type === "identifier") was exercised only by the "true" side (bare identifier keys); a computed key correctly falls through to (anonymous), but that fallback path was untested.

Rationale

  • Genuine, low-risk coverage gap identified via npm run test:coverage (branch coverage for jsLikeAnalyzer.ts was 98.33%, missing branch on line 228).
  • No production code changes — test-only addition, zero behavioral risk.
  • Confirms the existing fallback behavior (computed keys can't be statically resolved to a name, so (anonymous) is correct) is locked in by a regression test.

Test Status

npm run compile   ✅ (0 errors)
npm run lint      ✅ (0 warnings)
npm run test:unit ✅ 218 passing, 0 failing

Coverage improved: jsLikeAnalyzer.ts branch coverage 98.33% → 99.17% (line 228 fully covered; remaining gap at line 465 is a pre-existing, likely-defensive fallback in getOperator, left untouched per minimal-scope guidance).

Trade-offs

None — this is a pure test addition with no behavior change.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@42c2ab5b4e4c9273534c39259b2e0df7f20f07e9

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@askpt askpt changed the title [repo-assist] test: cover jsLikeAnalyzer computed object-property-key fallback test: cover jsLikeAnalyzer computed object-property-key fallback Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.85%. Comparing base (4667c58) to head (ed5db66).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #537      +/-   ##
==========================================
+ Coverage   81.82%   81.85%   +0.02%     
==========================================
  Files          13       13              
  Lines        4386     4386              
  Branches      450      450              
==========================================
+ Hits         3589     3590       +1     
+ Misses        796      795       -1     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@askpt
askpt marked this pull request as ready for review August 13, 2026 07:00
@askpt
askpt self-requested a review as a code owner August 13, 2026 07:00
Copilot AI balanced review requested due to automatic review settings August 13, 2026 07:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression coverage for computed object-property keys falling back to (anonymous) in the JavaScript analyzer.

Changes:

  • Tests computed-key anonymous function naming.
  • Verifies complexity remains correctly calculated.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@askpt
askpt merged commit e6930fc into main Aug 13, 2026
25 checks passed
@askpt
askpt deleted the repo-assist/test-jslike-computed-key-20260812-a84bc793dd6b204f branch August 13, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants